import request from '@/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/blade-anwise/stock/stock_in_main/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/blade-anwise/stock/stock_in_main/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/blade-anwise/stock/stock_in_main/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/blade-anwise/stock/stock_in_main/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/blade-anwise/stock/stock_in_main/submit',
    method: 'post',
    data: row
  })
}

export const saveStockIn = (row) => {
  return request({
    url: '/api/blade-anwise/stock/stock_in_main/saveStockIn',
    method: 'post',
    data: row
  })
}


export const stockInReport = (id,isEnglish,hiddenBom) => {
  return request({
    url: '/api/blade-anwise/stock/stock_in_main/stockInReport',
    method: 'get',
    params: {
      id: id,
      isEnglish:isEnglish,
      hiddenBom:hiddenBom
    }
  })
}


export const changeBillStatus = (params, type,status) => {
    return request({
        url: '/api/blade-anwise/stock/stock_in_main/changeBillStatus?type='+type+'&status='+status,
        method: 'get',
        params: {
            ...params,
        }
    })
}
